package com.lc.qianrenshiye;

import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Context;

import com.tencent.bugly.crashreport.CrashReport;
import com.zcx.helper.app.AppApplication;
import com.zcx.helper.app.AppInit;
import com.zcx.helper.glide.GlideLoader;
import com.zcx.helper.http.Http;

import cn.jpush.android.api.JPushInterface;

/**
 * Created by Administrator on 2016/3/14.
 */
@AppInit(name = "QianRenShiYe", log = true, initialize = false, width = 1280, scale = 1f)
public class BaseApplication extends AppApplication {

    public static BasePreferences BasePreferences;

//    public static BaseDB baseDB;

    @Override
    public void onCreate() {

        super.onCreate();

//        ShareSDK.initSDK(this);

//        CrashReport.initCrashReport(getApplicationContext(), "900053079", true);

//        baseDB = new BaseDB(this);

        Http.getInstance().setIsLog(true);

        Http.getInstance().setOnStartEndCreateDialog(new Http.OnStartEndCreateDialog() {

            @Override
            public Dialog onCreate(Context context) {

                ProgressDialog progressDialog = new ProgressDialog(context);

                return progressDialog;

            }

            @Override
            public void show(Dialog dialog) {

                dialog.setCanceledOnTouchOutside(false);
                dialog.show();

            }

            @Override
            public void dismiss(Dialog dialog) {

                dialog.dismiss();

            }

        });

        BasePreferences = new BasePreferences(this, "QianRenShiYe");

        GlideLoader.getInstance().init(R.id.default_id, R.mipmap.ic_launcher);

        JPushInterface.setDebugMode(true);

        JPushInterface.init(this);

        CrashReport.initCrashReport(getApplicationContext(), "acc5298c21", true);

//
//        BasicPushNotificationBuilder builder = new BasicPushNotificationBuilder(this);
//        builder.statusBarDrawable = R.mipmap.push_logo;
//        builder.notificationFlags = Notification.FLAG_AUTO_CANCEL
//                | Notification.FLAG_SHOW_LIGHTS;  //设置为自动消失和呼吸灯闪烁
//        builder.notificationDefaults = Notification.DEFAULT_SOUND
//                | Notification.DEFAULT_VIBRATE
//                | Notification.DEFAULT_LIGHTS;  // 设置为铃声、震动、呼吸灯闪烁都要
//        JPushInterface.setDefaultPushNotificationBuilder(builder);

    }

}
